#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
    int findMin(vector<int> &nums)
    {
        int n = nums.size() - 1;
        int l = 0, r = n;
        int x = nums[n];
        while (l < r)
        {
            int m = l + (r - l) / 2;
            if (nums[m] > x)
                l = m + 1;
            else
                r = m;
        }
        return nums[l];
    }
};